home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Freeware / Programare / highlight / highlight-W32GUI-2.2-10b-Setup.exe / {app} / src / ansigenerator.h < prev    next >
C/C++ Source or Header  |  2004-07-09  |  2KB  |  82 lines

  1. /***************************************************************************
  2.                          ansicode.h  -  description
  3.                              -------------------
  4.     begin                : Jul 5 2004
  5.     copyright            : (C) 2004 by Andre ∩┐╜Simon
  6.     email                : andre.simon1@gmx.de
  7.  ***************************************************************************/
  8.  
  9. /***************************************************************************
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  ***************************************************************************/
  17.  
  18. #ifndef ANSIGENERATOR_H
  19. #define ANSIGENERATOR_H
  20.  
  21. #include <iostream>
  22. #include <fstream>
  23. #include <string>
  24. #include <sstream>
  25.  
  26. #include "codegenerator.h"
  27. #include "charcodes.h"
  28. #include "version.h"
  29.  
  30. namespace highlight {
  31.  
  32. /** 
  33.    \brief This class generates ANSI escape sequences.
  34.    
  35.    It contains information about the resulting document structure (document 
  36.    header and footer), the colour system, white space handling and text 
  37.    formatting attributes.
  38.  
  39. * @author Andre Simon
  40. */
  41.  
  42. class AnsiGenerator : public highlight::CodeGenerator
  43.   {
  44.   public:
  45.   
  46.    /** Constructor          
  47.      \param colourTheme Name of Colour theme to use 
  48.     */
  49.     AnsiGenerator( const string &colourTheme);
  50.     AnsiGenerator();
  51.     ~AnsiGenerator();
  52.  
  53.    /** prints document header
  54.        \param  title Title of the document
  55.     */
  56.     string getHeader(const string & title);
  57.  
  58.     /** Prints document footer*/
  59.     string getFooter();
  60.  
  61.     /** Prints document body*/
  62.     void printBody();
  63.  
  64.   private:         
  65.   
  66.     /** \return escaped character*/
  67.     virtual string maskCharacter(unsigned char );
  68.   
  69.     
  70.     /** gibt ANSI-"Tags" zurueck (Farbindex+bold+kursiv)*/
  71.     string getOpenTag(const string&font, 
  72.                       const string&fgCol, const string&bgCol);
  73.   
  74.     
  75.   
  76.     string getMatchingOpenTag(unsigned int styleID);
  77.     string getMatchingCloseTag(unsigned int styleID);        
  78.   };
  79.  
  80. }
  81. #endif
  82.